using System;
using System.Linq;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using Widgetsphere.Autos.EFDAL;
using System.Text.RegularExpressions;
using System.Linq.Expressions;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity.Core.Objects.DataClasses;

namespace Widgetsphere.Autos.EFDAL.Entity
{
	/// <summary>
	/// The collection to hold 'Listingdisplayview' entities
	/// </summary>
	[DataContract]
	[Serializable]
	[System.Data.Linq.Mapping.Table(Name = "Listingdisplayview")]
	[System.CodeDom.Compiler.GeneratedCode("nHydrateModelGenerator", "5.3.0")]
	[EdmEntityTypeAttribute(NamespaceName = "Widgetsphere.Autos.EFDAL.Entity", Name = "Listingdisplayview")]
	[nHydrate.EFCore.Attributes.FieldNameConstantsAttribute(typeof(Widgetsphere.Autos.EFDAL.Entity.Listingdisplayview.FieldNameConstants))]
	[System.ComponentModel.ImmutableObject(true)]
	public partial class Listingdisplayview : nHydrate.EFCore.DataAccess.BaseEntity, Widgetsphere.Autos.EFDAL.Interfaces.Entity.IListingdisplayview, System.ICloneable, System.IEquatable<Widgetsphere.Autos.EFDAL.Interfaces.Entity.IListingdisplayview>
	{
		#region FieldNameConstants Enumeration

		/// <summary>
		/// Enumeration to define each property that maps to a database field for the 'Listingdisplayview' table.
		/// </summary>
		public enum FieldNameConstants
		{
			/// <summary>
			/// Field mapping for the 'BodyType' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'BodyType' property")]
			BodyType,
			/// <summary>
			/// Field mapping for the 'ConditionType' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'ConditionType' property")]
			ConditionType,
			/// <summary>
			/// Field mapping for the 'Cylinders' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'Cylinders' property")]
			Cylinders,
			/// <summary>
			/// Field mapping for the 'Description' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'Description' property")]
			Description,
			/// <summary>
			/// Field mapping for the 'Doors' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'Doors' property")]
			Doors,
			/// <summary>
			/// Field mapping for the 'Engine' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'Engine' property")]
			Engine,
			/// <summary>
			/// Field mapping for the 'ExpirationDate' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'ExpirationDate' property")]
			ExpirationDate,
			/// <summary>
			/// Field mapping for the 'FuelType' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'FuelType' property")]
			FuelType,
			/// <summary>
			/// Field mapping for the 'ListDate' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'ListDate' property")]
			ListDate,
			/// <summary>
			/// Field mapping for the 'ListingId' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'ListingId' property")]
			ListingId,
			/// <summary>
			/// Field mapping for the 'Make' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'Make' property")]
			Make,
			/// <summary>
			/// Field mapping for the 'MakeId' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'MakeId' property")]
			MakeId,
			/// <summary>
			/// Field mapping for the 'Metro' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'Metro' property")]
			Metro,
			/// <summary>
			/// Field mapping for the 'Mileage' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'Mileage' property")]
			Mileage,
			/// <summary>
			/// Field mapping for the 'Model' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'Model' property")]
			Model,
			/// <summary>
			/// Field mapping for the 'ModelId' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'ModelId' property")]
			ModelId,
			/// <summary>
			/// Field mapping for the 'Price' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'Price' property")]
			Price,
			/// <summary>
			/// Field mapping for the 'Title' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'Title' property")]
			Title,
			/// <summary>
			/// Field mapping for the 'TransmissionType' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'TransmissionType' property")]
			TransmissionType,
			/// <summary>
			/// Field mapping for the 'TrimLevel' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'TrimLevel' property")]
			TrimLevel,
			/// <summary>
			/// Field mapping for the 'Vin' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'Vin' property")]
			Vin,
			/// <summary>
			/// Field mapping for the 'Year' property
			/// </summary>
			[System.ComponentModel.ReadOnlyAttribute(true)]
			[System.ComponentModel.Description("Field mapping for the 'Year' property")]
			Year,
		}
		#endregion

		#region Properties

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 0)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("BodyType")]
		[System.Diagnostics.DebuggerNonUserCode]
		[StringLength(100)]
		public virtual string BodyType { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 1)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("ConditionType")]
		[System.Diagnostics.DebuggerNonUserCode]
		[StringLength(100)]
		public virtual string ConditionType { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 2)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("Cylinders")]
		[System.Diagnostics.DebuggerNonUserCode]
		public virtual int? Cylinders { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 3)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("Description")]
		[System.Diagnostics.DebuggerNonUserCode]
		[StringLength(4000)]
		public virtual string Description { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 4)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("Doors")]
		[System.Diagnostics.DebuggerNonUserCode]
		public virtual int? Doors { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 5)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("Engine")]
		[System.Diagnostics.DebuggerNonUserCode]
		[StringLength(100)]
		public virtual string Engine { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 6)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("ExpirationDate")]
		[System.Diagnostics.DebuggerNonUserCode]
		public virtual DateTime? ExpirationDate { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 7)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("FuelType")]
		[System.Diagnostics.DebuggerNonUserCode]
		[StringLength(100)]
		public virtual string FuelType { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 8)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("ListDate")]
		[System.Diagnostics.DebuggerNonUserCode]
		public virtual DateTime? ListDate { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Key]
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 9)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("ListingId")]
		[System.Diagnostics.DebuggerNonUserCode]
		public virtual int ListingId { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 10)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("Make")]
		[System.Diagnostics.DebuggerNonUserCode]
		[StringLength(100)]
		public virtual string Make { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 11)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("MakeId")]
		[System.Diagnostics.DebuggerNonUserCode]
		public virtual int? MakeId { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 12)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("Metro")]
		[System.Diagnostics.DebuggerNonUserCode]
		[StringLength(100)]
		public virtual string Metro { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 13)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("Mileage")]
		[System.Diagnostics.DebuggerNonUserCode]
		public virtual int? Mileage { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 14)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("Model")]
		[System.Diagnostics.DebuggerNonUserCode]
		[StringLength(100)]
		public virtual string Model { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 15)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("ModelId")]
		[System.Diagnostics.DebuggerNonUserCode]
		public virtual int? ModelId { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 16)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("Price")]
		[System.Diagnostics.DebuggerNonUserCode]
		public virtual int? Price { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 17)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("Title")]
		[System.Diagnostics.DebuggerNonUserCode]
		[StringLength(500)]
		public virtual string Title { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 18)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("TransmissionType")]
		[System.Diagnostics.DebuggerNonUserCode]
		[StringLength(100)]
		public virtual string TransmissionType { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 19)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("TrimLevel")]
		[System.Diagnostics.DebuggerNonUserCode]
		[StringLength(100)]
		public virtual string TrimLevel { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 20)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("Vin")]
		[System.Diagnostics.DebuggerNonUserCode]
		[StringLength(100)]
		public virtual string Vin { get; set; }

		/// <summary>
		/// </summary>
		[System.ComponentModel.DataAnnotations.Schema.Column(Order = 21)]
		[DataMember]
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.DisplayName("Year")]
		[System.Diagnostics.DebuggerNonUserCode]
		public virtual int? Year { get; set; }

		#endregion

		#region Equals
		/// <summary>
		/// Compares two objects of 'Listingdisplayview' type and determines if all properties match
		/// </summary>
		/// <returns>True if all properties match, false otherwise</returns>
		bool System.IEquatable<Widgetsphere.Autos.EFDAL.Interfaces.Entity.IListingdisplayview>.Equals(Widgetsphere.Autos.EFDAL.Interfaces.Entity.IListingdisplayview other)
		{
			return this.Equals(other);
		}

		/// <summary>
		/// Compares two objects of 'Listingdisplayview' type and determines if all properties match
		/// </summary>
		/// <returns>True if all properties match, false otherwise</returns>
		public override bool Equals(object obj)
		{
			var other = obj as Widgetsphere.Autos.EFDAL.Entity.Listingdisplayview;
			if (other == null) return false;
			return (
				other.BodyType == this.BodyType &&
				other.ConditionType == this.ConditionType &&
				other.Cylinders == this.Cylinders &&
				other.Description == this.Description &&
				other.Doors == this.Doors &&
				other.Engine == this.Engine &&
				other.ExpirationDate == this.ExpirationDate &&
				other.FuelType == this.FuelType &&
				other.ListDate == this.ListDate &&
				other.ListingId == this.ListingId &&
				other.Make == this.Make &&
				other.MakeId == this.MakeId &&
				other.Metro == this.Metro &&
				other.Mileage == this.Mileage &&
				other.Model == this.Model &&
				other.ModelId == this.ModelId &&
				other.Price == this.Price &&
				other.Title == this.Title &&
				other.TransmissionType == this.TransmissionType &&
				other.TrimLevel == this.TrimLevel &&
				other.Vin == this.Vin &&
				other.Year == this.Year
				);
		}

		/// <summary>
		/// Serves as a hash function for this type.
		/// </summary>
		public override int GetHashCode()
		{
			return base.GetHashCode();
		}

		#endregion

		#region IsEquivalent

		/// <summary>
		/// Determines if all of the fields for the specified object exactly matches the current object.
		/// </summary>
		/// <param name="item">The object to compare</param>
		public override bool IsEquivalent(nHydrate.EFCore.DataAccess.INHEntityObject item)
		{
			return ((System.IEquatable<Widgetsphere.Autos.EFDAL.Interfaces.Entity.IListingdisplayview>)this).Equals(item as Widgetsphere.Autos.EFDAL.Interfaces.Entity.IListingdisplayview);
		}

		#endregion

		#region Clone

		/// <summary>
		/// Creates a shallow copy of this object
		/// </summary>
		public virtual object Clone()
		{
			return Widgetsphere.Autos.EFDAL.Entity.Listingdisplayview.Clone(this);
		}

		/// <summary>
		/// Creates a shallow copy of this object with defined, default values and new PK
		/// </summary>
		public virtual object CloneAsNew()
		{
			var item = Widgetsphere.Autos.EFDAL.Entity.Listingdisplayview.Clone(this);
			return item;
		}

		/// <summary>
		/// Creates a shallow copy of this object
		/// </summary>
		public static Listingdisplayview Clone(Widgetsphere.Autos.EFDAL.Interfaces.Entity.IListingdisplayview item)
		{
			var newItem = new Listingdisplayview();
			newItem.BodyType = item.BodyType;
			newItem.ConditionType = item.ConditionType;
			newItem.Cylinders = item.Cylinders;
			newItem.Description = item.Description;
			newItem.Doors = item.Doors;
			newItem.Engine = item.Engine;
			newItem.ExpirationDate = item.ExpirationDate;
			newItem.FuelType = item.FuelType;
			newItem.ListDate = item.ListDate;
			newItem.ListingId = item.ListingId;
			newItem.Make = item.Make;
			newItem.MakeId = item.MakeId;
			newItem.Metro = item.Metro;
			newItem.Mileage = item.Mileage;
			newItem.Model = item.Model;
			newItem.ModelId = item.ModelId;
			newItem.Price = item.Price;
			newItem.Title = item.Title;
			newItem.TransmissionType = item.TransmissionType;
			newItem.TrimLevel = item.TrimLevel;
			newItem.Vin = item.Vin;
			newItem.Year = item.Year;
			return newItem;
		}

		#endregion

	}

}

